<html>
<head><meta charset="utf-8"><title>Cleaning up async/await · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html">Cleaning up async/await</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="154859348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154859348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154859348">(Jan 10 2019 at 18:07)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> do you have a preference for how to express "the minimum of all the following lifetimes" in HIR?</p>



<a name="154859449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154859449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154859449">(Jan 10 2019 at 18:09)</a>:</h4>
<p>I'm looking to clean up the async/await implementation and one of the big issues is that you can't have multiple different named lifetime parameters</p>



<a name="154859513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154859513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154859513">(Jan 10 2019 at 18:10)</a>:</h4>
<p>because the returned <code>impl Future</code> can live only as long as the shortest input lifetime</p>



<a name="154859519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154859519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154859519">(Jan 10 2019 at 18:10)</a>:</h4>
<p>and there's not a way to express that at the moment AFAICT</p>



<a name="154874999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154874999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154874999">(Jan 10 2019 at 21:51)</a>:</h4>
<p><span class="user-mention" data-user-id="127859">@Taylor Cramer</span> well <code>'a</code> and <code>'b...'z: 'a</code></p>



<a name="154875048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154875048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154875048">(Jan 10 2019 at 21:52)</a>:</h4>
<p>is how you would express it</p>



<a name="154875098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154875098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154875098">(Jan 10 2019 at 21:53)</a>:</h4>
<p>e.g.</p>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;b</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;c</span><span class="o">&gt;</span><span class="p">()</span><span class="w"></span>
<span class="k">where</span><span class="w"></span>
<span class="w">  </span><span class="na">&#39;b</span>: <span class="na">&#39;a</span><span class="p">,</span><span class="w"></span>
<span class="w">  </span><span class="na">&#39;c</span>: <span class="na">&#39;a</span><span class="p">,</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="154875105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154875105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154875105">(Jan 10 2019 at 21:53)</a>:</h4>
<p>not sure if that's what you want in HIR</p>



<a name="154875705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154875705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154875705">(Jan 10 2019 at 22:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Yeah I wasn't sure if there was a better way than introducing a new unnameable lifetime everywhere</p>



<a name="154875718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154875718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154875718">(Jan 10 2019 at 22:02)</a>:</h4>
<p>but I can certainly do it that way</p>



<a name="154877409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154877409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154877409">(Jan 10 2019 at 22:26)</a>:</h4>
<p><span class="user-mention" data-user-id="127859">@Taylor Cramer</span> can you say a bit more about what's causing the root error?</p>



<a name="154877428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154877428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154877428">(Jan 10 2019 at 22:27)</a>:</h4>
<p>or maybe I just need to revisit this with a clear head</p>



<a name="154877436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154877436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154877436">(Jan 10 2019 at 22:27)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> today we don't allow <code>async fn</code> with multiple named lifetimes in the arguments</p>



<a name="154877437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154877437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154877437">(Jan 10 2019 at 22:27)</a>:</h4>
<p>basically i'm wondering if the right path is instead to fix impl trait or something like that</p>



<a name="154877445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154877445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154877445">(Jan 10 2019 at 22:27)</a>:</h4>
<p>yeah maybe</p>



<a name="154877461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154877461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154877461">(Jan 10 2019 at 22:27)</a>:</h4>
<p>we do this because we need a lifetime to tack onto the <code>impl Future&lt;...&gt; + 'something</code> in the return type</p>



<a name="154877512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154877512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154877512">(Jan 10 2019 at 22:28)</a>:</h4>
<p>we also ban multiple elided lifetimes for the same reason</p>



<a name="154877515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154877515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154877515">(Jan 10 2019 at 22:28)</a>:</h4>
<p>and require that you name them</p>



<a name="154877567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154877567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154877567">(Jan 10 2019 at 22:29)</a>:</h4>
<p>So I'm looking to remove that restriction</p>



<a name="154877630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154877630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154877630">(Jan 10 2019 at 22:30)</a>:</h4>
<p>because aturon and boats thought it was a blocker for stabilization</p>



<a name="154877651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154877651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154877651">(Jan 10 2019 at 22:30)</a>:</h4>
<p>but I'm not quite of the best path towards a fix</p>



<a name="154878294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154878294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154878294">(Jan 10 2019 at 22:41)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> did you have some other thought about how we should be handling this?</p>



<a name="154944411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944411">(Jan 11 2019 at 20:25)</a>:</h4>
<p><span class="user-mention" data-user-id="127859">@Taylor Cramer</span> sorry I had to disappear and just got back to read</p>



<a name="154944439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944439">(Jan 11 2019 at 20:25)</a>:</h4>
<p>It would be great if you could give me a specific example</p>



<a name="154944487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944487">(Jan 11 2019 at 20:26)</a>:</h4>
<p>sure!</p>



<a name="154944491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944491">(Jan 11 2019 at 20:26)</a>:</h4>
<p>in particular, I'm wondering:</p>
<p>Is this related to that problem of "hidden lifetimes" that we encontered with impl trait?</p>



<a name="154944501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944501">(Jan 11 2019 at 20:26)</a>:</h4>
<p>Not particularly, no</p>



<a name="154944509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944509">(Jan 11 2019 at 20:26)</a>:</h4>
<p>ok</p>



<a name="154944517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944517">(Jan 11 2019 at 20:26)</a>:</h4>
<p>then an example would definitely be useful</p>



<a name="154944534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944534">(Jan 11 2019 at 20:27)</a>:</h4>
<p><code>async fn foo&lt;'a, 'b&gt;(x: &amp;'a u8, y: &amp;'b u8) {}</code></p>



<a name="154944537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944537">(Jan 11 2019 at 20:27)</a>:</h4>
<p>needs to desugar to something like</p>



<a name="154944593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944593">(Jan 11 2019 at 20:28)</a>:</h4>
<p><code>fn foo&lt;'a, 'b, 'c&gt;(x: &amp;'a u8, y: &amp;'b u8) -&gt; impl Future&lt;Output = ()&gt; + 'c where 'a: 'c, 'b: 'c { ... }</code></p>



<a name="154944640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944640">(Jan 11 2019 at 20:28)</a>:</h4>
<p>or rather</p>



<a name="154944672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944672">(Jan 11 2019 at 20:28)</a>:</h4>
<p><code>fn foo&lt;'a, 'b&gt;(x: &amp;'a u8, y: &amp;'b u8) -&gt; impl Future&lt;Output = ()&gt; + 'intersection_of_a_and_b { ... }</code></p>



<a name="154944718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944718">(Jan 11 2019 at 20:29)</a>:</h4>
<p>it seems at least partly related</p>



<a name="154944773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944773">(Jan 11 2019 at 20:30)</a>:</h4>
<p>"medium related"?</p>



<a name="154944777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944777">(Jan 11 2019 at 20:30)</a>:</h4>
<p>it's a distinct issue</p>



<a name="154944801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944801">(Jan 11 2019 at 20:30)</a>:</h4>
<p>(I have to say I sometimes regret that we didn't adopt the "explicit captures in the impl" design)</p>



<a name="154944813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944813">(Jan 11 2019 at 20:30)</a>:</h4>
<p>well, is it?</p>



<a name="154944872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944872">(Jan 11 2019 at 20:31)</a>:</h4>
<p>/me thinks a bit</p>



<a name="154944927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944927">(Jan 11 2019 at 20:32)</a>:</h4>
<p>the intention is clearly that you should be able to "work with" data from <code>x</code> and <code>y</code> during the fn as normal</p>



<a name="154944959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154944959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154944959">(Jan 11 2019 at 20:33)</a>:</h4>
<p>I think what i'm wondering about is basically "why do we need a <code>'c</code> exactly"</p>



<a name="154945041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945041">(Jan 11 2019 at 20:34)</a>:</h4>
<p><em>if</em> we had the <code>impl&lt;...&gt;</code> explicit syntax, you might have imagined desugaring to </p>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;b</span><span class="o">&gt;</span><span class="p">(...)</span><span class="w"> </span>-&gt; <span class="nc">impl</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;b</span><span class="o">&gt;</span><span class="w">  </span><span class="n">Future</span><span class="o">&lt;</span><span class="n">Output</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">()</span><span class="o">&gt;</span><span class="w"></span>
</pre></div>


<p>syntax, right?</p>



<a name="154945085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945085">(Jan 11 2019 at 20:35)</a>:</h4>
<p>I'm trying to remember what our HIR setup is internally, wondering if we can desugar to something that doesn't have a direct syntax right now</p>



<a name="154945675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945675">(Jan 11 2019 at 20:44)</a>:</h4>
<p>I don't believe there's a direct way to represent that in HIR today</p>



<a name="154945686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945686">(Jan 11 2019 at 20:44)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> similarly, it's not just an issue with named lifetimes but also with elided ones</p>



<a name="154945706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945706">(Jan 11 2019 at 20:45)</a>:</h4>
<p>I think you can represent it</p>



<a name="154945712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945712">(Jan 11 2019 at 20:45)</a>:</h4>
<p>oh?</p>



<a name="154945716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945716">(Jan 11 2019 at 20:45)</a>:</h4>
<p>put another way, this desugars into an existential type</p>



<a name="154945724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945724">(Jan 11 2019 at 20:45)</a>:</h4>
<p>(ultimately)</p>



<a name="154945741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945741">(Jan 11 2019 at 20:45)</a>:</h4>
<div class="codehilite"><pre><span></span>existential type Foo&lt;&#39;a, &#39;b&gt;;

fn foo&lt;&#39;a, &#39;b&gt;(...) -&gt; Foo&lt;&#39;a, &#39;b&gt;
</pre></div>



<a name="154945790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945790">(Jan 11 2019 at 20:46)</a>:</h4>
<p>I'm not sure how straightforward it is to set that stuff up, but I think that is what you want to express, isn't it?</p>



<a name="154945806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945806">(Jan 11 2019 at 20:46)</a>:</h4>
<p>here's the code in question: <a href="https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L2086" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L2086">https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L2086</a></p>



<a name="154945866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945866">(Jan 11 2019 at 20:47)</a>:</h4>
<p>and it does this today by pushing a bound on: <a href="https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L2285" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L2285">https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L2285</a></p>



<a name="154945889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945889">(Jan 11 2019 at 20:47)</a>:</h4>
<p>but perhaps if we didn't use <code>lower_existential_impl_trait</code> and bypassed it</p>



<a name="154945891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945891">(Jan 11 2019 at 20:47)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L2236" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L2236">https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L2236</a></p>



<a name="154945996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154945996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154945996">(Jan 11 2019 at 20:49)</a>:</h4>
<p>we could add more things to the lifetime_defs list <a href="https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L1345" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L1345">https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L1345</a></p>



<a name="154946033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154946033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154946033">(Jan 11 2019 at 20:49)</a>:</h4>
<p>and we could omit that lifetime bound entirely</p>



<a name="154946265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154946265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154946265">(Jan 11 2019 at 20:52)</a>:</h4>
<p>Yeah, that fails on nightly today</p>



<a name="154946287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154946287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154946287">(Jan 11 2019 at 20:53)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> : <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=9688e3897e0dddf9a7ddae5ab0c46ad8" target="_blank" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=9688e3897e0dddf9a7ddae5ab0c46ad8">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=9688e3897e0dddf9a7ddae5ab0c46ad8</a></p>



<a name="154946305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154946305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154946305">(Jan 11 2019 at 20:53)</a>:</h4>
<p>"ambiguous lifetime bound: neither 'a nor 'b outlives the other"</p>



<a name="154946530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154946530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154946530">(Jan 11 2019 at 20:56)</a>:</h4>
<p>ah yeah we added that limitation</p>



<a name="154946543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154946543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154946543">(Jan 11 2019 at 20:56)</a>:</h4>
<p>I've been thinking about how to lift it by making the region solver smarter</p>



<a name="154946545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154946545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154946545">(Jan 11 2019 at 20:56)</a>:</h4>
<p>(for other reasons)</p>



<a name="154946552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154946552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154946552">(Jan 11 2019 at 20:56)</a>:</h4>
<p>but I guess that's probably a bit off</p>



<a name="154946634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154946634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154946634">(Jan 11 2019 at 20:58)</a>:</h4>
<p>well, I guess that adding an implicit bound is the best we can do today; I'd probably prefer that to making the HIR more magical.. btw how do we deal with "late-bound vs early-bound" today in this sort of thing, do you know? do we effectively make all regions in an async fn early bound?</p>



<a name="154949897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154949897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154949897">(Jan 11 2019 at 21:49)</a>:</h4>
<p>I believe the opposite</p>



<a name="154949903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154949903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154949903">(Jan 11 2019 at 21:49)</a>:</h4>
<p>if you try and apply any lifetimes</p>



<a name="154949913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154949913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154949913">(Jan 11 2019 at 21:49)</a>:</h4>
<p>(manually)</p>



<a name="154949914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154949914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154949914">(Jan 11 2019 at 21:49)</a>:</h4>
<p>it complains that you can't apply late-bound lifetimes</p>



<a name="154950271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154950271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154950271">(Jan 11 2019 at 21:55)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> So for now you'd recommend introducing a new unnameable (in the surface lang) lifetime that we can use for this purpose? And somehow specifying that <code>'_</code> must outlive that lifetime?</p>



<a name="154950341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/154950341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#154950341">(Jan 11 2019 at 21:56)</a>:</h4>
<p>it all seems extremely dodgy to me but I don't have a good idea of how to do this in a more principled way</p>



<a name="155285863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/155285863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#155285863">(Jan 16 2019 at 20:33)</a>:</h4>
<p>Well, I guess I'm going to give this a shot b.c. after sleeping on it for a while I still have no idea how to do this in a more reasonable way</p>



<a name="155285952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/155285952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#155285952">(Jan 16 2019 at 20:34)</a>:</h4>
<p>so my plan is to expand all elided lifetimes in elidable input positions to separate named <code>elided async lifetime #&lt;..&gt;</code> lifetimes</p>



<a name="155285978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/155285978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#155285978">(Jan 16 2019 at 20:34)</a>:</h4>
<p>add them all to the parameters of the fn</p>



<a name="155286162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/155286162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#155286162">(Jan 16 2019 at 20:37)</a>:</h4>
<p>and add a lifetime named <code>async</code> (note the lack of a <code>'</code> to prevent collision) and add a requirement to the where clause that all lifetimes that appear in the function signature that aren't introduced there (by e.g. <code>for&lt;..&gt;</code> or elided lifetimes inside <code>fn</code>/<code>Fn</code> syntax) must outlive the lifetime named <code>async</code></p>



<a name="155286180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/155286180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#155286180">(Jan 16 2019 at 20:37)</a>:</h4>
<p>this seems likely to cause some messy code and some less-than-desirable diagnostics</p>



<a name="155286193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Cleaning%20up%20async/await/near/155286193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Cleaning.20up.20async.2Fawait.html#155286193">(Jan 16 2019 at 20:37)</a>:</h4>
<p>but It's all I've come up with at this point</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>